import { post} from '@/request/http'
import store from '@/store'

// 供应商账户管理
// 列表数据
export const supplierCreationList = (data) =>
  post(
    '/FTKJWLHYPT/base/seletSysCompanyInfos',
    {
      Data: {
        Parameters: {
          FTKJWLHYPT: {
            fltName:data.fltName,
            fltPorts:data.fltPorts,
            fltDepId:store.state.user.DPTID_DX_H
          }
        },
        Orderbys: {},
        PageIndexs: {
          FTKJWLHYPT: data.PageIndexs
        },
        PageSizes: {
          FTKJWLHYPT: data.PageSizes
        }
      }
    }
  )
// 新增
export const addSupplierCreation = (data) =>
  post(
    '/FTKJWLHYPT/base/addSysCompanyInfo',
    {
      Data: {
        Parameters: {
          FTKJWLHYPT: {
            fltName:data.fltName,
            fltCode:data.fltCode,
            fltType:data.fltType.join(','),
            fltTypes:data.fltTypes.join(','),
            fltStatus:data.fltStatus,
            fltLinkperson:data.fltLinkperson,
            fltLinkphone:data.fltLinkphone,
            fltLisenses:data.fltLisenses,
            fltLisensestruck:data.fltLisensestruck,
            fltPrvCode:data.fltPrvCode,
            fltPorts:data.fltPorts,
            fltEmail:data.fltEmail,
            fltUrl:data.fltUrl,
            fltInterval:data.fltInterval,
            fltGrade:data.fltGrade,
            fltX:data.fltX,
            fltY:data.fltY,
            fltRemark:data.fltRemark,
            fltDepId:store.state.user.DPTID_DX_H
          }
        },
      }
    }
  )
  // 编辑
export const editSupplierCreation = (data) =>
  post(
    '/FTKJWLHYPT/base/updateSysCompanyInfo',
    {
      Data: {
        Parameters: {
          FTKJWLHYPT: {
            fltId:data.fltId,
            fltName:data.fltName,
            fltCode:data.fltCode,
            fltType:data.fltType.join(','),
            fltStatus:data.fltStatus,
            fltLinkperson:data.fltLinkperson,
            fltLinkphone:data.fltLinkphone,
            fltLisenses:data.fltLisenses,
            fltLisensestruck:data.fltLisensestruck,
            fltPrvCode:data.fltPrvCode,
            fltPorts:data.fltPorts,
            fltEmail:data.fltEmail,
            fltUrl:data.fltUrl,
            fltInterval:data.fltInterval,
            fltGrade:data.fltGrade,
            fltX:data.fltX,
            fltY:data.fltY,
            fltRemark:data.fltRemark,
          }
        },
      }
    }
  )

export const XLSupplierCreation = () =>
  post(
    '/FTKJWLHYPT/dropDown/getPortsInfoByDptId',
    {
      Data: {
        Parameters: {
          FTKJWLHYPT: {
            potDptId:store.state.user.DPTID_DX_H,
            potFltId:store.state.user.FLT_UUID_DX_H //车队id
          }
        },
      }
    }
  )
export const typeDataA = (data) =>
  post(
    '/FTKJWLHYPT//dropDown/getPortsInfoByPrvCode',
    {
      Data: {
        Parameters: {
          FTKJWLHYPT: {
            potPrvCode:data.potPrvCode
          }
        },
      }
    }
  )
